The EU issue has devided the Tory party for decades. David Cameron took a calculated gamble that by having a referendum he could settle the argument. He lost. Boris Johnson is an opportunist that thought that if he led the leave campaign and lost but with a significant leave vote be would be ideally placed to be the next PM. He won, and in doing so he lost because if he becomes PM David Cameron is leaving a poison chalice for the next leader of pulling the article 50 trigger to leave.
I guess the moral of the story is don't use your electorate to have a proxy leadership power struggle. Their vote may just surprise you.